package com.company.myfirstjmixproject.entity.bom;

import com.company.myfirstjmixproject.entity.bom.Routing;
import io.jmix.core.entity.annotation.JmixGeneratedValue;
import io.jmix.core.metamodel.annotation.InstanceName;
import io.jmix.core.metamodel.annotation.JmixEntity;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@JmixEntity
@Table(name = "MST_ROUTING_DETAIL")
@Entity
public class RoutingDetail {
    @JmixGeneratedValue
    @Column(name = "ID", nullable = false)
    @Id
    private Long id;

    @Column(name = "VERSION", nullable = false)
    @Version
    private Integer version;

    @JoinColumn(name = "ROUTING_ID", nullable = false)
    @NotNull
    @ManyToOne(optional = false)
    private Routing routing;

    @Column(name = "ROUTING_STEP", nullable = false)
    private Integer routingStep;

    @Column(name = "ROUTING_DETAIL_DESC")
    @InstanceName
    private String routingDetailDesc;

    @Column(name = "RESOURCE_GROUP", nullable = false)
    private String resourceGroup;

    public Routing getRouting() {
        return routing;
    }

    public void setRouting(Routing routing) {
        this.routing = routing;
    }

    public Integer getRoutingStep() {
        return routingStep;
    }

    public void setRoutingStep(Integer routingStep) {
        this.routingStep = routingStep;
    }

    public String getRoutingDetailDesc() {
        return routingDetailDesc;
    }

    public void setRoutingDetailDesc(String routingDetailDesc) {
        this.routingDetailDesc = routingDetailDesc;
    }

    public String getResourceGroup() {
        return resourceGroup;
    }

    public void setResourceGroup(String resourceGroup) {
        this.resourceGroup = resourceGroup;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}